import { Component, Input, OnInit } from "@angular/core";
import { Pedge } from "src/app/@types/pedge";

@Component({
    selector: "pedge-pnode",
    styles: [
        `
            .edge-wrapper {
                height: 2px;
                width: 100%;
            }
            .edge-wrapper[empty] {
                background: linear-gradient(
                    to right,
                    #c2c2c2,
                    #c2c2c2 6.5px,
                    transparent 6.5px,
                    transparent
                );
                background-size: 10px 100%;
            }
            .edge-wrapper[default] {
                background-color: #c2c2c2;
            }
            .edge-wrapper[success] {
                background-color: #28d6a2;
            }
        `,
    ],
    template: `
        <ng-container [ngSwitch]="data.type">
            <div *ngSwitchCase="0" class="edge-wrapper" empty></div>
            <div *ngSwitchCase="1" class="edge-wrapper" default></div>
            <div *ngSwitchCase="2" class="edge-wrapper" success></div>
        </ng-container>
    `,
})
export class PedgeComponent implements OnInit {
    @Input() data: Pedge;

    constructor() {}

    ngOnInit(): void {}
}
